<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>aspect-ratio</title>
    <style>
      body,
      ul {
        margin: 0;
        padding: 0;
      }
      ul li {
        list-style: none;
      }
      .box {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
      }
      .list {
        flex-basis: calc(25% - 1.5rem / 4);
        aspect-ratio: 1 / 1;
      }
      .list img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
    </style>
  </head>
  <body>
    <ul class="box">
      <li class="list">
        <img src="./1.jpg" />
      </li>
      <li class="list">
        <img src="./2.jpg" />
      </li>
      <li class="list">
        <img src="./3.jpg" />
      </li>
      <li class="list">
        <img src="./4.png" />
      </li>
    </ul>
  </body>
</html>
